package main

import (
	"fmt"
	"math"
)

func Sqrt(x float64) float64 {
	const E = 0.0000000001

	z := float64(1)
	k := float64(0)

	i := 0
	for ; ; z = z - (z*z-x)/(z+z) {
		if z-k <= E && z-k >= -E {
			fmt.Println(i)
			return z
		}
		k = z
		fmt.Println(z)
		i++
	}
}

func main() {
	fmt.Println(Sqrt(3))
	fmt.Println(math.Sqrt(3))
}
